home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 38
/
Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso
/
-seriously_amiga-
/
misc
/
football
/
user
/
flipschedule.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-02-03
|
3KB
|
87 lines
/* ***********************************************************************
FLIPSCHEDULE PROGRAM FOR FOOTBALL REXX SUITE
----------------------------------------------
Copyright Mark Naughton 1996
Version Date History
--------------------------------------------------------------------------
1.0 270996 First release.
1.1 121196 Added to Football as a callable component. Amended for
different leagues. Removed messages.
131196 Added checks for files - if not found, exits without
a message.
241196 Now called as an External script. Added info messages.
**************************************************************************
Procedure
---------
1. Check files exist. Open Learn file and output file.
2. Read from Learn, then flip the home and away teams, reset the scores
to 'not_played' and then write to output file.
3. Close files and end. When finished this file can then be printed off
and it'll make entering data into GAMEPLAY much easier.
************************************************************************** */
ARG league_file
league_file = "Data/" || league_file
version = 1
input_file = '.sflearn'
output_file = '.sflisting'
not_played = '__ __'
separator = '*'
if exists(league_file || input_file) = 0 then exit
say "This program will flip the schedule and display all the"
say "alternate fixtures. If a schedule is not known, then it"
say "is 'learnt' using 'Enter Scores'. When the season is halfway"
say "through, this program can be run to print the next half"
say "of the seasons fixtures. A file '"league_file || output_file"'"
say "produced and can then be printed."
say
say "Working..."
say
if open(datafile,league_file || input_file,'r') then do
if open(datafile2,league_file || output_file,'w') then do
do while ~eof(datafile)
line = readln(datafile)
if pos(separator,line) = 0 then do
home = substr(line,1,30)
away = substr(line,41,30)
line = overlay(away,line,1)
line = overlay(home,line,41)
if pos(not_played,line) = 0 & words(line) > 0 then
line = overlay(not_played,line,32)
end
writeln(datafile2,line)
end
close(datafile2)
say "Schedule has been 'flipped'."
say "The file '"league_file || output_file"' can now be printed."
say
say
end
else do
say
say "ERROR : (FlipSchedule)"
say
say "Cannot open '"league_file || output_file"' for writing."
close(datafile)
exit
end
close(datafile)
end
else do
say
say "ERROR : (FlipSchedule)"
say
say "Cannot open '"league_file || input_file"' for reading."
end
exit